import axios from "@/libs/api.request";
export default {
  // 获取首页信息API
  getHomePage(data) {
    return axios.request({
      url: `/v1/homePage/getHomePage`,
      params: data,
      method: "get"
    });
  },
  // 查看设备信息
  getEquipmentSysInfo(data) {
    return axios.request({
      url: `/v1/equipment/getEquipmentSysInfo`,
      data: data,
      method: "post"
    });
  },
  // 分页查询资源明细列表
  getSourceTableList(data) {
    return axios.request({
      url: `/v1/sourceTable/getSourceTableList`,
      data: data,
      method: "post"
    });
  },
  // 新增源明细列表
  addTable(data) {
    return axios.request({
      url: `/v1/sourceTable/addTable`,
      data: data,
      method: "post",
      contentType: "multipart/form-data"
    });
  },
  exportExcel(data) {
    return axios.request({
      url: `/v1/file/downTemplate`,
      params: data,
      method: "get"
    });
  },
  // 查看ZIP结果
  zipResult(data) {
    return axios.request({
      url: `/v1/file/zipResult`,
      params: data,
      method: "get"
    });
  },
  // 下载压缩包ZIP
  downloadZip(data) {
    return axios.request({
      url: `/v1/file/downloadZip`,
      params: data,
      method: "get"
    });
  },
  // 根据资源编号查看详情
  tableDetail(data) {
    return axios.request({
      url: `/v1/sourceTable/detail`,
      params: data,
      method: "post"
    });
  },
  deleteTableStructure(data) {
    return axios.request({
      url: `/v1/sourceTable/deleteTableStructure`,
      data: data,
      method: "post"
    });
  },
  // 查看表结构列表
  getTableStructureList(data) {
    return axios.request({
      url: `/v1/sourceTable/getTableStructureList`,
      data: data,
      method: "post"
    });
  },
  // 修改表结构
  updateTableStructure(data) {
    return axios.request({
      url: `/v1/sourceTable/updateTableStructure`,
      data: data,
      method: "post"
    });
  },
  // 表资源导入（CSV或TXT格式）
  importTableSourceByCSV(data) {
    return axios.request({
      url: `/v1/sourceTable/importTableSourceByCSV`,
      data: data,
      method: "post",
      contentType: "multipart/form-data"
    });
  },
  // MonitoringRulesCreate(data) {
  //   return axios.post(
  //     httpHeader() + "/msgrules/biMonitoringRules/add.json",
  //     data,
  //     { headers: { "Content-Type": "multipart/form-data" } }
  //   );
  // },
  // 导出表资源接口(stxp_zdry_xpxx表导出的图片文件)
  sourceExport(data) {
    return axios.request({
      url: `/v1/sourceTable/sourceExport`,
      data: data,
      method: "post"
    });
  },
  // 表结构导出
  tableStructureExport(data) {
    return axios.request({
      url: `/v1/sourceTable/tableStructureExport`,
      data: data,
      method: "post"
    });
  },

  // 导出接口 -- 导出自定义字段
  optionExport(data) {
    return axios.request({
      url: `/v1/sourceTable/optionExport`,
      data: data,
      method: "post"
    });
  },
  // 上传附件
  upload(data) {
    return axios.request({
      url: `/v1/file/upload`,
      data: data,
      method: "post",
      contentType: "multipart/form-data"
    });
  },

  // 修改资源
  updateTable(data) {
    return axios.request({
      url: `/v1/sourceTable/updateTable`,
      data: data,
      method: "post"
    });
  },
  // 删除资源
  deleteTable(data) {
    return axios.request({
      url: `/v1/sourceTable/deleteTable`,
      params: data,
      method: "post"
    });
  },

  // 分页查询资源请求列表
  getResourceReqList(data) {
    return axios.request({
      url: `/v1/resourceReq/getResourceReqList`,
      data: data,
      method: "post"
    });
  },
  // 分页查询消费记录列表
  getDataEntryList(data) {
    return axios.request({
      url: `/v1/dataEntry/getDataEntryList`,
      data: data,
      method: "post"
    });
  },
  // 消费记录详情
  getDetailById(data) {
    return axios.request({
      url: `/v1/dataEntry/getDetailById`,
      params: data,
      method: "post"
    });
  },
  // 分页查询用户列表
  getPageList(data) {
    return axios.request({
      url: `/v1/user/getPageList`,
      data: data,
      method: "post"
    });
  },
  // 添加用户
  addUser(data) {
    return axios.request({
      url: `/v1/user/addUser`,
      data: data,
      method: "post"
    });
  },
  // 更新用户
  updateUser(data) {
    return axios.request({
      url: `/v1/user/updateUser`,
      data: data,
      method: "post"
    });
  },
  // 删除用户
  deleteUser(data) {
    return axios.request({
      url: `/v1/user/deleteUser`,
      params: data,
      method: "post"
    });
  },
  // 修改密码
  updatePassword(data) {
    return axios.request({
      url: `/v1/user/updatePassword`,
      data: data,
      method: "post"
    });
  },
  // 重置密码
  resetPassword(data) {
    return axios.request({
      url: `/v1/user/resetPassword`,
      params: data,
      method: "post"
    });
  },
  // 账号停用
  stopOrStart(data) {
    return axios.request({
      url: `/v1/user/stopOrStart`,
      params: data,
      method: "post"
    });
  },
  // 分页查询角色列表
  getRoleList(data) {
    // debugger
    return axios.request({
      url: `/v1/role/getRoleList`,
      data: data,
      method: "post"
    });
  },
  // 查看角色详情
  getById(data) {
    // debugger
    return axios.request({
      url: `/v1/role/getById`,
      params: data,
      method: "post"
    });
  },
  // 添加角色
  addRole(data) {
    return axios.request({
      url: `/v1/role/addRole`,
      data: data,
      method: "post"
    });
  },
  // 更新角色
  updateRole(data) {
    return axios.request({
      url: `/v1/role/updateRole`,
      data: data,
      method: "post"
    });
  },
  // 删除角色
  deleteRole(data) {
    return axios.request({
      url: `/v1/role/deleteUser`,
      params: data,
      method: "post"
    });
  }
};
